package com.gw.vip.message.controller;

import com.gw.vip.common.log.PrintlnLog;
import com.gw.vip.common.vo.Result;
import com.gw.vip.message.dto.MessageDto;
import com.gw.vip.message.zib.MessageBiz;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author GW
 * @description
 * @since 2022-04-17
 */
@RestController
@RequestMapping("message")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class MessageController {

    private final MessageBiz messageBiz;

    @PrintlnLog(description = "发送消息")
    @PostMapping("send")
    public Result send(@RequestBody @Valid MessageDto dto){
        messageBiz.send(dto);
        return Result.success();
    }
}
